<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<!-- 引入 layui.css -->
<link rel="stylesheet" href="/hospital_system/layui-v2.6.8/layui/css/layui.css"/>
<!-- 引入 layui.js -->
<script src="/hospital_system/layui-v2.6.8/layui/layui.js"></script>
</head>
<body>

<p>您觉得医生的服务怎么样？</p>
  <div id="test1"></div>
 
  <script>
  layui.use('rate', function(){
    var rate = layui.rate;
   
    //渲染
    var ins1 = rate.render({
      elem: '#test1'  //绑定元素
    });
    //显示文字
    rate.render({
      elem: '#test1'
      ,value: 5 //初始值
      ,text: true //开启文本
    });
    rate.render({
    	  elem: '#test1'
    	  ,choose: function(value){
    	    if(value > 4) alert( '么么哒' )
    	    if(value == 4) alert( '嘿咻~我们会继续努力滴！' )
    	    if(value == 3) alert( '已收到反馈！' )
    	    if(value == 2) alert( '十分抱歉，给您带来不好的体验' )
    	    if(value == 1) alert( '十分抱歉，给您带来不好的体验' )
    	    location.href="/hospital_system/pingfenController?ysid="+<%=request.getAttribute("ysid")%>+"&value="+value;     						          
    	  }
    	});
  });
  </script>
</body>
</html>